/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'ADD': '新增',
    'Attack Speed Max': '攻击速度最大',
    'CLEAR': '清除',
    'Combat': '战斗',
    'Consume': '消耗',
    'Critters': '小动物',
    'Consume Time': '消耗时间',
    'DIE': '死亡',
    'Die': '死亡',
    'Enemy': '敌人',
    'Fight': '战斗',
    'Export': '导出',
    'Export/Import': '导出/导入',
    'Fight': '战斗',
    'Rewards': '奖励',
    'Import': '导入',
    'Saving in ...': '保存中...',
    'Strength': '力量',
    'Voidling': '虚空',
    'Hunt': '狩猎',
    'Save': '保存',
    'Toad': '蟾蜍',
    'When the list runs out...': '当列表用完时...',
    'You have a base value of': '你有一个基本值',
    'You have consumed': '你消耗了',
    'FLEE!': '逃跑！',
    'Fruit': '水果',
    'FIGHT': '战斗',
    'Export puts the save in your Ctrl-V': '导出会将存档内容放入剪切板，按Ctrl-V粘贴到安全的地方',
    'Log': '日志',
    'Moss': '苔藓',
    'Plants': '植物',
    'Health': '生命值',
    'Health Max': '生命值上限',
    'Hunt Time': '狩猎时间',
    'Import blank to hard reset.': '导入空内容会硬重置。',
    'Mandrake': '曼德拉草',
    'Mushroom': '蘑菇',
    'Pause': '暂停',
    'Each extra you consume causes you to take +1 poison dmg/s until you die.': '每次消耗的额外能量都会使您受到 +1中毒伤害/秒，直到死亡。',
    'One strength is one damage.': '1点力量就是1点伤害。',
    'Start Fighting after Death': '死后开始战斗',
    'Start the list over': '重新开始列表',
    'The maximum health. Dead at 0.': '生命值最大值。变为0后会死亡。',
    'damage dealt with': '点对敌人造成的伤害',
    'physical': '属性是物理的',
    'Enemy killed!': '敌人被杀死了！',
    'remaining health!': '剩余生命值！',
    'Starting the fight!': '开始战斗!',
    'health lost from': '生命值丢失因为',
    'poison': '中毒',
    'Poison': '中毒',
    'You have died!': '你被杀死了!',
    'Adds to defense, which reduces physical damage taken. Reduction from constitution': '增加防御力，减少受到的物理伤害。 减少体质',
    'Constitution': '体质',
    'Health Regen': '生命值恢复',
    'Mana Max': '法力上限',
    'Recover': '恢复',
    'Reflect': '反射',
    'Regen this amount every second.': '每秒回复这个量。',
    'Scavenge': '清除',
    'When an opponent attacks, deals damage. Ignores flat reduction from Harden.': '当对手攻击时，造成伤害。 忽略硬化的单位缩减。',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    ' gained for': ' 增加的',
    ". After reduction": "。减少后",
    '1% of stat gain goes to your base stats. When you die, you start with base stats.': '1%的属性增加到你的基础属性。当你死的时候，你从基础属性开始。',

    //原样
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "Health: ": "生命值: ",
    "Mana: ": "法力: ",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "Time it takes to find an enemy of this type. Reduced by the Hunt stat": "找到这种敌人所需的时间。 随着狩猎属性提升而减少",
    "Time it takes to deal damage. Reduced by the Agility stat": "造成伤害所需的时间。 随着敏捷属性提升而减少",
    "Time it takes to consume an enemy for stats. Reduced by the Scavenge stat": "消耗敌人的时间需要统计数据。 随着清除属性提升而减少",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    " ": "",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "\n": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^x?\d+(\.\d+)?[A-Za-z%]{0,2}(\s.C)?\s*$/, //12.34K,23.4 °C
    /^x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /^\s*$/, //纯空格
    /^\d+(\.\d+)?[A-Za-z]{0,2}.?\(?([+\-]?(\d+(\.\d+)?[A-Za-z]{0,2})?)?$/, //12.34M (+34.34K
    /^(\d+(\.\d+)?[A-Za-z]{0,2}\/s)?.?\(?([+\-]?\d+(\.\d+)?[A-Za-z]{0,2})?\/s\stot$/, //2.74M/s (112.4K/s tot
    /^\d+(\.\d+)?(e[+\-]?\d+)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?$/, //2.177e+6 (+4.01+4
    /^(\d+(\.\d+)?(e[+\-]?\d+)?\/s)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?\/s\stot$/, //2.177e+6/s (+4.01+4/s tot
];
var cnExcludePostfix = [
    /:?\s*x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /:?\s*x?\d+(\.\d+)?[A-Za-z]{0,2}$/, //: 12.34K, x1.5
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
var cnRegReplace = new Map([
    [/^(.+) x Moss \($/, '$1 x 苔藓 \('],
    [/^(.+) x Fruit \($/, '$1 x 水果 \('],
    [/^(.+) x Mandrake \($/, '$1 x 曼德拉草 \('],
    [/^(.+) x Mushroom \($/, '$1 x 蘑菇 \('],
    [/^(.+) x Toad \($/, '$1 x 蟾蜍 \('],
    [/^You died after (.+)s.$/, '你将在 $1 秒后死亡。'],
    [/^(\d+) Royal points$/, '$1 皇家点数'],
    [/^Cost: (\d+) RP$/, '成本：$1 皇家点数'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);